
public class a {
	
	    public static void sort(int a[], int x, int y) {
	        int i, j, z;
	        if (x > y) {
	            return;
	        }
	        i = x;
	        j = y;
	        z = a[i]; 
	        while (i < j) { 
	            while (i < j && a[j] >= z)
	                j--;
	            if (i < j)
	                a[i++] = a[j];
	            while (i < j && a[i] < z)
	                i++;
	            if (i < j)
	                a[j--] = a[i];
	        }
	        a[i] = z;
	        sort(a, x, i - 1); 
	        sort(a, i + 1, y); 

	    }

	    public static void quicksort(int a[]) {
	        sort(a, 0, a.length - 1);
	    }

	    public static void main(String[] args) {

	        int a[] = { 15,1,2,5,32,15,1,2,5,34 };
	        quicksort(a);
	        for(int c=0;c<a.length; c++)
            {
                System.out.print(a[c] + " ");
          }
	    }
}
